package main

import (
	"fmt"
	"sort"
)

func testIntSort() {
	var a = [...]int{1, 7, 39, 2, 348, 484}
	fmt.Printf("%T\n", a)
	sort.Ints(a[:])
	fmt.Println(a)
}

func testStrings() {
	var a = [...]string{"abc", "efg", "hij", "B", "A"}
	sort.Strings(a[:])
	fmt.Println(a)
}

func testFloat() {
	var a = [...]float64{2.3, 5.6, 7.8, 1.1, 1.0, 0.9}
	sort.Float64s(a[:])
	fmt.Println(a)
}

func testIntSearch() {
	var a = [...]int{1, 8, 45, 2, 333, 322}
	sort.Ints(a[:])
	fmt.Println(a)
	index := sort.SearchInts(a[:], 2)
	fmt.Println(index)
}

func main() {
	//testIntSort()
	//testStrings()
	//testFloat()
	testIntSearch()
}
